﻿using DemoUser.Application.User.Dtos;
using DemoUser.Application.User.Filter;
using DemoUser.Application.User.Interface;
using DemoUser.Core.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoUser.Application.User
{
    //[TypeFilter(typeof(WangActionFilter))]
    public class BrandAppService:IDynamicApiController
    {
        private readonly IBrandService _brandService;

        public BrandAppService(IBrandService brandService)
        {
            _brandService = brandService;
        }

        [HttpGet]
        //[SystemInterceptor]
        public List<Brand> GetBrands()
        {
            return _brandService.SelectAll();
        }

        [HttpGet]
        public Brand GetBrand(int id)
        {
            return _brandService.SelectById(id);
        }

        [HttpGet]
        public List<Model> models()
        {
            return _brandService.GroupByStatus();
        }
    }
}
